﻿using System.Collections.Generic;
using System.Data.Common;

namespace Songhay.Data.GenericWeb.Procedures
{
    using Songhay.Data.GenericWeb.Properties;

    /// <summary>
    /// List procedures into the DBMS.
    /// </summary>
    public static partial class List
    {
        /// <summary>
        /// List Search results of the specified search string.
        /// </summary>
        /// <param name="commonConnection">The common connection.</param>
        /// <param name="searchString">The search string.</param>
        /// <returns>Returns an XML <see cref="System.String"/>.</returns>
        public static string Search(DbConnection commonConnection, string searchString)
        {

            string s = string.Format("%{0}%", searchString);

            Dictionary<string, object> param = new Dictionary<string, object>(1);
            param.Add("@Search", s);

            s = Common.CommonScalar.GetString(commonConnection, Resources.Search, param);

            return s;
        }
    }
}
